#pragma once

/*
*	Stores the statistics of the Backtest
*/

enum TYPE : char { _BUY, _SELL, _COVER, _SHORT };

typedef struct {
	DateTime Dt;
	double Price;
	double Shares;
	TYPE Type; 
}Trade;

class BTStatistics
{
	private:
		double _InitialCapital;
		double _EndingCapital;
		int _NumTrades;
		int _NumWins;
		double _MaxDrawdown;
		vector<Trade> _TradesBuySell;
		vector<Trade> _TradesShortCover;

	public:
		BTStatistics(void);
		~BTStatistics(void);

		void AddTrade(TYPE type, double price, DateTime dt);

		int GetNumTrades() { return this->_NumTrades; }
		int GetNumWins() { return this->_NumWins; }
		double GetNetProfit() { return this->_EndingCapital - this->_InitialCapital; }
		double GetMaxDrawdown() { return this->_MaxDrawdown; }
		vector<Trade> GetBuySellTrades() { return this->_TradesBuySell; }
		vector<Trade> GetShortCoverTrades() { return this->_TradesShortCover; }
};

